
namespace Battle
{
	
	public class IdleToWalk : BaseTransition
	{
		public override bool Transite(FsmContext context, ref FsmState nxt)
		{
			Actor a = context.Actor;
			//存在攻击目标 不在攻击范围内
			if (a.Target != null && !a.InAttackRange(a.Target))
			{
				nxt = FsmState.Walk;
				return true;
			}
			return false;
		}
	}
	public class IdleToAttack : BaseTransition
	{
		public override bool Transite(FsmContext context, ref FsmState nxt)
		{
			Actor a = context.Actor;
			//存在攻击目标 且攻击目标在攻击范围内
			if (a.Target != null && a.InAttackRange(a.Target))
			{
				nxt = FsmState.Attack;
				return true;
			}
			else
			{
				return false;
			}
		}
	}
}